<template>
	<div class="footer" v-show="showFoot">
		<footer-item v-for="item in infos" :info="item"></footer-item>
	</div>
</template>
<script>
	import {updateTitle} from './../vuex/action'
	import FooterItem from './FooterItem'

	export default {
		data: function () {
			return {
				infos: [{
					path: '/focus',
					name: '关注'
				},
				{
					path: '/',
					name: '发现'
				},
				// {
				// 	path: '/write',
				// 	name: '写作'
				// },
				{
					path: '/user',
					name: '我的'
				}]
			}
		},
		vuex: {
			actions: {
				updateTitle
			}
		},
		computed: {
			showFoot: function () {
				let url = '/focus/user'
				if (url.indexOf(this.$route.path) === -1) return false
				return true
			}
		},
		components: {
			FooterItem
		}
	}
</script>
<style scoped>
	.footer{
		background-color: #fafafa;
		display: flex;
		right: 0;
		bottom:0;
		left: 0;
		position: fixed;
		text-align: center;
		font-size: 1.5rem;
	}
</style>